<template>
  <div class="CKZS" v-if="ArrayId.length>0">
    <!-- <img :src="" alt=""> -->
    <div v-for="(item, index) in ArrayId" :key="index">
      <img :src="aseUrl + 'api/upload/oss/preview?fileId=' + item" alt="" width="100%" />
    </div>
  </div>
  <div class="CKZS" v-else>
    <div v-if="ArrayId.length==0" style="height: 78vh;text-align:center;padding-top: 20vh;">
      <div style="margin-bottom: 10px;">
        <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png" />
      </div>
      <div>暂无数据</div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.CKZS {
  padding: 10px;
  height: 100vh;
  overflow: auto;
  img {
    margin-top: 10px;
  }
}
</style>

<script>
import { getPicture } from '@/utils/api.js'
export default {
  data() {
    return {
      id: '',
      ArrayId: [],
      aseUrl: window.g.BaseURL
    }
  },
  created() {
    this.id = this.$route.query.data
    this.getdata()
  },
  methods: {
    async getdata() {
      const res = await getPicture(this.id)
      if (res.data.msg == '未找到证书') {
        this.$confirm({
          title: '提示',
          message: '未找到证书',
          btn: {
            okText: '确定',
            cancelText: '取消'
          }
        })
          .then(() => {
            this.$router.go(-1)
          })
          .catch(() => {
            console.log('no')
          })
      } else {
        this.ArrayId = res.data.data
      }
    }
  }
}
</script>
